using System;
using WindowsPhoneEssentials.Tasks;
using WindowsPhoneMVC.Interfaces;
using WindowsPhoneMVC.Navigation.Interfaces;

namespace WindowsPhoneMVC.Navigation
{
    public class NavigationContext
    {
        public INavigator Navigator { get; private set; }
        public IViewLocator ViewLocator { get; private set; }
        public ITaskManager TaskManager { get; private set; }
        public IPhoenixApplication PhoenixApplication { get; private set; }
        public NavigationRequest Request { get; internal set; }

        public NavigationContext(
            INavigator navigator,
            IViewLocator viewLocator,
            ITaskManager taskManager,
            IPhoenixApplication phoenixApplication,
            NavigationRequest request)
        {
            if (navigator == null) throw new ArgumentNullException("navigator");
            if (viewLocator == null) throw new ArgumentNullException("viewLocator");
            if (request == null) throw new ArgumentNullException("request");

            Navigator = navigator;
            ViewLocator = viewLocator;
            TaskManager = taskManager;
            PhoenixApplication = phoenixApplication;
            Request = request;
        }
    }
}